<script setup>
// TODO: 编辑
import { ref, defineExpose } from 'vue'
const form = ref({
  name: '',
  place: ''
})
// 弹框开关
const dialogVisible = ref(false)
const open = (row) => {
//  form.value.name = row.name;
//  form.value.place = row.place;
form.value = {...row}
  dialogVisible.value = true;
}
// 抛出子组件的函数
defineExpose({
  open
})

</script>

<template>
  <el-dialog v-model="dialogVisible" title="编辑" width="400px">
    <el-form label-width="50px">
      <el-form-item label="姓名">
        <el-input placeholder="请输入姓名"  v-model="form.name"/>
      </el-form-item>
      <el-form-item label="籍贯">
        <el-input placeholder="请输入籍贯" v-model="form.place"/>
      </el-form-item>
    </el-form>
    <template #footer>
      <span class="dialog-footer">
        <el-button @click="dialogVisible = false">取消</el-button>
        <el-button type="primary" @click="dialogVisible = false">确认</el-button>
      </span>
    </template>
  </el-dialog>
</template>

<style scoped>
.el-input {
  width: 290px;
}
</style>
